]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
weather: Handle missing permission store
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 3 Apr 2019 10:35:03 +0000 (12:35 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 3 Apr 2019 13:27:42 +0000 (13:27 +0000)
Our weather integration is supposed to follow GNOME Weather's settings,
including its permission to use location services. However there's a
discrepancy in case xdg-desktop-portal is unavailable:

While our geoclue agent grants all applications access to location
services in that case, the weather integration treats it as if
access was denied.

Fix this by handling this case explicitly.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1130

js/misc/weather.js

index aaec36cf438e1f2cc526e9296cf8446b341183e9..e804bdee96970e4ff75a5993e6a33e81074d08c2 100644 (file)
@@ -30,6 +30,14 @@ var WeatherClient = class {
                 return;
             }
 
+            if (this._permStore.g_name_owner == null) {
+                // Failed to auto-start, likely because xdg-desktop-portal
+                // isn't installed; don't restrict access to location service
+                this._weatherAuthorized = true;
+                this._updateAutoLocation();
+                return;
+            }
+
             this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
                 if (error)
                     log('Error looking up permission: ' + error.message);